import axios from 'axios';
import { ElMessage } from 'element-plus'
interface result{
    code:number,
    data:any,
    msg:string,
}

const request = axios.create({
    baseURL: '/api', 
    timeout: 120000,
})

request.interceptors.response.use(  
    response => {  
        return response; 
    },  
    error => {  
        ElMessage({
            message:`服务不可用，请稍后重试`,
            grouping:true,
            type:'error'
        })
        return Promise.reject(error);  
    }  
);  

export default request